<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :adjustments} %>

<% content_for :page_title do %>
   / <%= plural_resource_name(Spree::Adjustment) %>
<% end %>

<% content_for :page_actions do %>
  <%= button_link_to(Spree.t(:new_adjustment), new_admin_order_adjustment_url(@order), class: "btn-success", icon: 'add') if can? :create, Spree::Adjustment %>
<% end %>

<% if @adjustments.present? %>
  <div class="panel panel-default">
    <%= render partial: 'adjustments_table' %>
  </div>
<% else %>
  <div class="alert alert-warning">
    <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Adjustment)) %>
  </div>
<% end %>

<% if @order.can_add_coupon? %>
  <div class="well" data-hook="adjustments_new_coupon_code">
    <div class="form-group">
      <%= text_field_tag "coupon_code", "", placeholder: Spree.t(:coupon_code), class: "form-control" %>
    </div>
    <%= button Spree.t(:add_coupon_code), 'plus', 'submit', id: "add_coupon_code" %>
  </div>
<% end %>

<%= javascript_tag do %>
  var order_number = '<%= @order.number %>';
<% end %>

<%= render partial: 'spree/admin/shared/order_summary' %>
